package Routes

import (
	"source-admin-go/src/controllers"
	"source-admin-go/src/middlewares"

	"github.com/gin-gonic/gin"
)

/**
 * 初始化路由配置
 * @Description:
 * @return *gin.Engine
 */
func InitRouter() *gin.Engine {
	r := gin.New()

	r.Use(gin.Logger())
	r.Use(gin.Recovery())

	api := r.Group("/api")
	api.Use(middlewares.Auth())

	controllers.RegisterRoute(api)

	return r
}
